package com.railway.common.util;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import cn.org.rapid_framework.util.holder.ApplicationContextHolder;

public class InitApplicationContextServlet  extends HttpServlet{

	/**
	 * 自动生成序列号
	 */
	private static final long serialVersionUID = -911553579769372190L;

	/**
	 * 初始化ApplicationContextHolder里的context，避免加载两次
	 */
	public void init() throws ServletException {
		super.init();
		/*ApplicationContext ctx = WebApplicationContextUtils
				.getRequiredWebApplicationContext(this.getServletContext());
		*/// 初始化applicationContextHolder的spring context
		ApplicationContext ctx = WebApplicationContextUtils
		.getRequiredWebApplicationContext(this.getServletContext());
	    System.out.println("nidaye");
	    StaticMap.initInfor(ctx);
	    System.out.print("nidayeend");
		 
	}
}
